<template>
    <div>
        <Table border :columns="columns" :data="tableData"></Table>
    </div>
</template>

<script>

export default {
    props: {
        tableData: Array,
        access: Object
    },
    data () {
        return {
            columns: [
                {
                    title: '序号',
                    type: 'index',
                    width: 60,
                    align: 'center'
                },
                {
                    title: '签约人姓名',
                    align: 'center',
                    width:100,
                    key: 'signerName'
                },
                {
                    title: '签约人手机',
                    align: 'center',
                    width:120,
                    key: 'signerPhone'
                },
                {
                    title: '签约人身份证号',
                    align: 'center',
                    width:180,
                    key: 'signerCardNumber'
                },
                {
                    title: '企业名称',
                    align: 'center',
                    width:200,
                    key: 'partyName'
                },
                {
                    title: '电子邮箱',
                    align: 'center',
                    width:360,
                    key: 'email'
                },
                {
                    title: '签约人类型',
                    align: 'center',
                    key: 'signerType',
                    width:120,
                    render: (h, params) => {
                        if (params.row.signerType === 1) {
                            return h('span', '法人')
                        }  else if(params.row.signerType === 2) {
                            return h('span', '代理人')
                        }else {
                            return h('span', '其他')
                        }
                    }
                },
                {
                    title: '审核状态',
                    align: 'center',
                    key: 'ebqAuthStatus',
                    width:120,
                    render: (h, params) => {
                        if (params.row.ebqAuthStatus === 3) {
                            return h('span', '待审核')
                        }  else if(params.row.ebqAuthStatus === 1) {
                            return h('span', '审核成功')
                        } else if(params.row.ebqAuthStatus === 2) {
                            return h('span', '审核失败')
                        } else if(params.row.ebqAuthStatus === 4) {
                            return h('span', '签章验证中')
                        }else {
                            return h('span', '其他')
                        }
                    }
                },
                {
                    title: '银行开户行',
                    align: 'center',
                    width:180,
                    key: 'accountName'
                },
                {
                    title: '开户行名称',
                    align: 'center',
                    width:180,
                    key: 'bankName'
                },
                {
                    title: '开户行账号',
                    align: 'center',
                    width:180,
                    key: 'bankNumber'
                },
                // {
                //     title: '审核时间',
                //     align: 'center',
                //     width:180,
                //     key: 'auditTime'
                // },
                {
                    title: '创建时间',
                    align: 'center',
                    width:180,
                    key: 'createTime'
                },
                {
                    title: '操作',
                    key: 'action',
                    width: 160,
                    align: 'center',
                    fixed: 'right',
                    render: (h, params) => {
                        return h('div', [
                            h(
                                'Button',
                                {
                                    props: {
                                        type: 'warning',
                                        size: 'small'

                                    },
                                    style: {
                                        marginRight: '5px',
                                    },
                                    on: {
                                        click: () => {
                                            this.goaudit(params.row.id)
                                        }
                                    }
                                },
                                '审核'
                            ),
                            h(
                                'Button',
                                {
                                    props: {
                                        type: 'primary',
                                        size: 'small'
                                    },
                                    style: {
                                        marginRight: '5px'
                                    },
                                    on: {
                                        click: () => {
                                            this.goDetail(params.row.id)
                                        }
                                    }
                                },
                                '详情'
                            )
                        ])
                    }
                }
            ],
        }
    },
    created () {
        this.init()
    },
    activated () {
        this.init()
    },
    methods: {
        init () {},
        goaudit (id) {
            let argu = {
                id: id
            }
            this.$router.push({
                name: 'electronicaudit',
                params: argu
            })
        },
        goDetail (id) {
            let argu = {
                id: id
            }
            this.$router.push({
                name: 'electronicdetail',
                params: argu
            })
        },
    },

}
</script>



